package com.xy.yunduo.utils.response;

public class ApiException extends RuntimeException {
    private static final long serialVersionUID = -4739326916397979619L;
    //自定义错误码
    private Integer code;
    //自定义构造器，只保留一个，让其必须输入错误码及内容
    public ApiException(ErrorCode errorCode) {
        super(errorCode.message);
        this.code = errorCode.code;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
